<template>
	<view class="policy pages">
		<view class="nav">
			<uni-icons type="closeempty" size="24" @click="back" style="z-index: 100;"></uni-icons>
			<view>{{name}}</view>
		</view>
		<view v-html="content" style="margin-top: 20rpx;"></view>
	</view>
</template>

<script>
	import { article } from '@/api/api.js'
	export default {
		data() {
			return {
				name: '',
				content: ''
			};
		},
		onLoad(option) {
			this.article(option.type)
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			article(type) {
				article({
					type: type
				}).then(res => {
					this.name = res.data.data[0].name
					this.content = res.data.data[0].content
				})
			}
		}
	}
</script>

<style lang="scss">
	.policy {
		padding: 10px;
		box-sizing: border-box;
		font-size: 30rpx;
	}

	.nav {
		display: flex;
		justify-content: space-between;
		align-items: center;

		&>view {
			position: absolute;
			width: 100%;
			text-align: center;
			font-size: 40rpx;
		}
	}
</style>